<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
                xmlns:h="http://xmlns.jcp.org/jsf/html"
                xmlns:f="http://xmlns.jcp.org/jsf/core"
                xmlns:p="http://primefaces.org/ui"
                template="/WEB-INF/template.xhtml">
                
    <ui:define name="title">
        TreeTable <span class="subitem">Column Resize</span>
    </ui:define>

    <ui:define name="description">
        Columns can be resized in two ways, with a helper or live.
    </ui:define>

    <ui:param name="documentationLink" value="/components/treetable"/>
    <ui:param name="widgetLink" value="TreeTable-1"/>

    <ui:define name="implementation">

        <h:form>

            <div class="card">
                <h5>Basic</h5>
                <p:treeTable value="#{ttBasicView.root}" var="document" style="margin-bottom:20px"
                             resizableColumns="true" showGridlines="true">
                    <p:column headerText="Name">
                        <h:outputText value="#{document.name}"/>
                    </p:column>
                    <p:column headerText="Size">
                        <h:outputText value="#{document.size}"/>
                    </p:column>
                    <p:column headerText="Type">
                        <h:outputText value="#{document.type}"/>
                    </p:column>
                </p:treeTable>
            </div>

            <div class="card">
                <h5>Live</h5>
                <p:treeTable value="#{ttBasicView.root}" var="document" resizableColumns="true" liveResize="true"
                             showGridlines="true">
                    <p:column headerText="Name">
                        <h:outputText value="#{document.name}"/>
                    </p:column>
                    <p:column headerText="Size">
                        <h:outputText value="#{document.size}"/>
                    </p:column>
                    <p:column headerText="Type">
                        <h:outputText value="#{document.type}"/>
                    </p:column>
                </p:treeTable>
            </div>

        </h:form>

    </ui:define>

</ui:composition>
